Page({
  data: { id: '', name: '', ssid: '', pwd: '' },
  onLoad(q) { this.setData({ id: q.id || '', name: decodeURIComponent(q.name || '') }); },
  onSsid(e) { this.setData({ ssid: e.detail.value }); },
  onPwd(e) { this.setData({ pwd: e.detail.value }); },
  next() {
    const { id, ssid, pwd } = this.data;
    if (!ssid) { wx.showToast({ title: '请输入WiFi名', icon: 'none' }); return; }
    wx.navigateTo({ url: `/pages/provision/progress/progress?id=${encodeURIComponent(id)}&ssid=${encodeURIComponent(ssid)}&pwd=${encodeURIComponent(pwd)}` });
  }
});


